package Memento;

import java.util.ArrayList;

public class Conserje {
	  static int cont;
	 public Conserje()
	  {
		  cont=0;
	  }
	  /**
	 * @uml.property  name="savedStates"
	 * @uml.associationEnd  multiplicity="(0 -1)" elementType="Memento.Memento"
	 */
	private ArrayList<Memento> savedStates = new ArrayList<Memento>();
	  
	  public void addMemento(Memento m) { savedStates.add(m);
	  cont++;
	  }
	  public Memento getMemento() {
		  Memento res = savedStates.get(cont-1);
		  cont--;
		  return res; 
		  }
}
